<?php

namespace App\Http\Controllers;

use App\Models\Agreement;
use Illuminate\Http\Request;

class AgreementController extends BaseController
{
    public function index()
    {
        $data = Agreement::query()
                  ->select(['id','agreement_name'])
                  ->where('status',1)
                  ->get();


        return $this->success($data);

    }


    public function show(Request $request)
    {

        $param = $this->validate($request,[
            'agreement_id' => 'required|integer'
        ]);

        $data = Agreement::query()
                ->select(['agreement_name','agreement_content'])
                ->where('id',$param['agreement_id'])
                ->first();


        return $this->success($data);
    }
}
